This folder contains the matlab codes and the data required to replicate the main tables and figures of the paper "Currency Risk Premia Redux",
by F. Nucera, L. Sarno and G. Zinna, published in The Review of Financial Studies.

The replication kit contains the following folders and m.files which replicate 
Table 1, Table 2 and Table 3 of the main text + Figure 1, Figure 2 (numerical output, no actual figure) 
Figure 3, Figure 4, Figure 5 (numerical output and simplified version). 

In particular, 

- Main_replicationcode: m.file to run to replicate tables and figures as specified above. Need DATA and FUNCTIONS to work (see below)

- DATA, including: dataP.mat (dates in matlab format), G.mat (candidate risk factors), R.mat (test asset' returns), 
  MatFctLab.mat (factors' labels),  MatPrtLab.mat(test assets' labels), hmldata.mat (hml portfolio returns), Fig3_input.mat (input required to reproduce Figure 3).

- FUNCTIONS, including: cdfchic.m, f_first_pass.m, f_pval_2S.m, gmm_fmb_lambdas.m, 
  hac_var.m, lettau_rp.m, my_orth.m, rppca_rfs.m, vec.m, nwest.m, mprint.m, ols.m, beta_inv.m, tdis_inv.m, beta_pdf.m,
  f_avgretNW.m, f_get_eigenvalues.m, f_fig3.m, Fig_1.m, Fig_4.m, f_tstat_2pval.m

  Please notice that the function vec.m is available on the Stefano Giglio's website in the replication folder 
  of the paper "Tests Assets and Weak Factors"
  https://sites.google.com/view/stefanogiglio/data-code
  whereas the function rppca_rfs.m builds upon the code available for the paper "Asset Pricing with Omitted Factors" (JPE, 2021)
  
  Please notice that the functions nwest.m, ols.m, beta_inv.m, tdis_inv.m, beta_pdf.m and mprint.m are taken from Jim Lesage's spatial-econometrics toolbox. 
  The toolbox is available on https://www.spatial-econometrics.com/. For documentation of the spatial econometrics functions see:
  Introduction to Spatial Econometrics (January, 2009), CRC Press/Taylor & Francis Group 

  Please notice that cdfchic.m, hac_var.m and gmm_fmb_lambdas.m are taken from the replication package of the paper
  "The Cross Section of Foreign Currency Risk Premia  and Consumption Growth Risk: Comment" by Craig Burnside, 
  published on American Economic Review, vol.101, n.7, December 2011. The replication
  package is available on https://www.aeaweb.org/articles?id=10.1257/aer.101.7.3456
  For these m.files the copyrights of the American Economic Association apply. For completness we also report the  AEA disclaimers below:
 
  % COPYRIGHT 2011 American Economic Association. 

  % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  % ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  % WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  % ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  % (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  % LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  % ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  % (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  % SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

